<script setup>
import { ref, provide } from 'vue';
import { RouterLink,RouterView } from 'vue-router';
import router from '@/router';
//反馈信息组件
import DialogApi from "@/components/prompt/dialog-api.vue";
import LoadingApi from "@/components/prompt/loading-api.vue";
import MessageApi from "@/components/prompt/message-api.vue";
import NotificationApi from "@/components/prompt/notification-api.vue";
//全局方法注册
function toPage(pageName='/') {
  if (pageName.length>1){
    let nextPage = '/'+pageName
    router.push(nextPage)
  }else {
    router.push(pageName)
  }
}
provide('toPage', {toPage})
</script>

<template>
  <!--  设置加载状态条-->
  <n-loading-bar-provider>
    <LoadingApi />
  </n-loading-bar-provider>
  <!--  设置提示信息-->
  <n-message-provider>
    <MessageApi />
  </n-message-provider>
  <!--  设置通知消息-->
  <n-notification-provider>
    <NotificationApi />
  </n-notification-provider>
  <!--  对话框设置-->
  <n-dialog-provider>
    <DialogApi/>
  </n-dialog-provider>
  <n-scrollbar trigger="hover">
    <RouterView />
  </n-scrollbar>
</template>

<style >

</style>
